<template>
  <div class="container">
    <div class="middle-detail">
      <p class="title">{{ articleDetail?.title }}</p>
      <div class="desc align-center">
        <span class="user">{{ articleDetail.author?.nikname }}</span>
        <span class="time">{{ articleDetail?.date | parseTimeTz }}</span>
        <p class="see">
          <i class="iconfont icon-iconkuozhan_liulanpre"></i>
          <span>{{ articleDetail?.hit_num }}</span>
        </p>
      </div>
      <Viewer class="content" :value="articleDetail?.content" v-if="articleDetail?.is_markdown"></Viewer>
      <div class="content" v-html="articleDetail?.content" v-else></div>
    </div>
  </div>
</template>

<script>
import { Viewer } from '@bytemd/vue'

export default {
  name: 'MiddleDetail',
  components: {
    Viewer
  },
  props: {
    articleDetail: {
      type: Object,
      default: () => ({})
    }
  }
}
</script>

<style lang="scss" scoped>
.middle-detail {
  width: 730px;
  padding: 20px;
  background-color: #fff;
  .title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
  }
  .desc {
    margin-bottom: 30px;
    .user {
      color: #515767;
      margin-right: 20px;
      font-size: 14px;
    }
    .time {
      color: #8a919f;
      margin-right: 20px;
    }
    .see {
      .iconfont {
        margin-right: 3px;
      }
      span {
        color: #8a919f;
      }
    }
  }
  .content {
    color: #333;
    line-height: 24px;
    font-size: 16px;
  }
}
</style>
